package com.janj.dao;

import com.janj.bean.Grade;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface GradeOnStudentMapper {



    @Select("SELECT * FROM grade")
    @Results({
            @Result(column ="gid" ,property = "gid"),
            @Result(column = "gname",property = "gname"),
            @Result(
             column = "gid",
             property = "students",
             javaType = List.class,
             many = @Many(select="com.janj.dao.StudentMapper.selectStudentByGradeid")

            )
    })
    public abstract List<Grade> selectGradeOnStudent();

}
